
package com.chy.utilsdemo.Arith;

/**
 * 功能： 精确的浮点数运算示例代码
 *
 * ──────────────────────────────────────────
 *   version  变更日期    修改人    修改说明
 * ------------------------------------------
 *   V1.0.0   2021/9/16     CHY     初版
 * ──────────────────────────────────────────
 * @author CHY
 */
public class ArithTest {
    public static void main(String[] args) {
        double num1 = 520.0;
        double num2 = 250.0;
        //加
        double add = Arith.add(num1, num2);
        System.out.println(num1 + "+" + num2 + "=" + add);
        //减
        double sub = Arith.sub(num1, num2);
        System.out.println(num1 + "-" + num2 + "=" + sub);
        //乘
        double mul = Arith.mul(num1, num2);
        System.out.println(num1 + "*" + num2 + "=" + mul);
        //除
        double div = Arith.div(num1, num2, 3);
        System.out.println(num1 + "/" + num2 + "=" + div);
    }
}
